/*
 *https://leetcode.cn/problems/climbing-stairs/description/
 *70.爬楼梯
 *medium, 叶佳豪 2024.9.20
 *动态规划
 */

class Solution {
public:
    int climbStairs(int n) {
        int b = 0, j = 0, r = 1;
        for (int i = 1; i <= n; ++i) {
            b = j; 
            j = r; 
            r = b + j;
        }
        return r;
    }
};